﻿// <copyright file="Enums.cs" company="Beuth Hochschule für Technik">
// Breakdown - Configure your Windows 7 Firewall
// Copyright (C) 2009 Stefan "dersteps@gmail.com" Matyba
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; 
// either version 3 of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/.
// </copyright>
// <author>Stefan Matyba</author>
// <email>dersteps@gmail.com</email>
// <date>2009-10-18</date>
// <summary>Application logic part: Firewall rule Enumerations</summary>

namespace Breakdown.Logic
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Enums Actions rules can/have to take when applied
    /// </summary>
    public enum RuleAction
    {
        /// <summary>
        /// The Rule has no action defined
        /// </summary>
        None,

        /// <summary>
        /// All traffic will be allowed for this rule
        /// </summary>
        Allow,

        /// <summary>
        /// Only IPSec-authorized connections are allowed
        /// </summary>
        AllowIfSecure,

        /// <summary>
        /// All traffic is blocked by this rule
        /// </summary>
        Block
    }

    /// <summary>
    /// Enums possible appliances for firewall rules
    /// </summary>
    [Flags]
    public enum RuleAppliances
    {
        /// <summary>
        /// The Rule does not apply to any profile
        /// </summary>
        None = 0x0,

        /// <summary>
        /// The Rule applies if the computer is connected to its corporate domain
        /// </summary>
        Domain = 0x1,

        /// <summary>
        /// The Rule applies if the computer is connected to a private network
        /// </summary>
        Private = 0x2,

        /// <summary>
        /// The Rule applies if the computer is connected to a public network
        /// </summary>
        Public = 0x4
    }

    /// <summary>
    /// Enums protocol types the firewall affects
    /// </summary>
    public enum Protocol
    {
        /// <summary>
        /// No protocol specified
        /// </summary>
        None,

        /// <summary>
        /// Other or unknown protocol - get the number from user!
        /// </summary>
        Custom,

        /// <summary>
        /// Affects any protocol
        /// </summary>
        Any,

        /// <summary>
        /// Affects only TCP connections
        /// </summary>
        TCP = 6,

        /// <summary>
        /// Affects only UDP connections
        /// </summary>
        UDP = 17,

        /// <summary>
        /// Affects only HOPOPT
        /// </summary>
        HOPOPT,

        /// <summary>
        /// Affects only ICMPv4
        /// </summary>
        ICMPv4 = 1,

        /// <summary>
        /// Affects only IGMP
        /// </summary>
        IGMP = 2,

        /// <summary>
        /// Affects only IPv6
        /// </summary>
        IPv6 = 41,

        /// <summary>
        /// Affects only IPv6Route
        /// </summary>
        IPv6Route = 43,

        /// <summary>
        /// Affects only IPv6Frag
        /// </summary>
        IPv6Frag = 44,

        /// <summary>
        /// Affects only GRE
        /// </summary>
        GRE = 47,

        /// <summary>
        /// Affects only ICMPv6
        /// </summary>
        ICMPv6 = 58,

        /// <summary>
        /// Affects only IPv6NoNxt
        /// </summary>
        IPv6NoNxt = 59,

        /// <summary>
        /// Affects only IPv6Opts
        /// </summary>
        IPv6Opts = 60,

        /// <summary>
        /// Affects only VRRP
        /// </summary>
        VRRP = 112,

        /// <summary>
        /// Affects only PGM
        /// </summary>
        PGM = 113,

        /// <summary>
        /// Affects only L2TP
        /// </summary>
        L2TP = 115
    }
}
